<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>新增标的</title>
<style type="text/css">
	.a_upfile {
		display: inline-block;
		width: 100px;
		height: 25px;
		background: white;
		position: relative;
		overflow: hidden;
	}
	.upfile {
		position: absolute;
		right: 0;
		top: 0;
		font-size: 100px;
		opacity: 0;
		filter: alpha(opacity = 0);
	}
</style>
</head>
<body>
<script type="text/javascript">
 	function valid4borrowInfo(label, pattern, value, validEle, maskEle, isCheckNull){
		value = value.replace(/(^\s*)|(\s*$)/g, "");
		if(value.length > 0)
		{
			if(new RegExp(pattern).test(value))
			{
				$('#'+validEle+'').hide();
				$('#'+maskEle+'').hide();
				return true;
			}
			else
			{
				$('#'+validEle+'').html("<label>&nbsp;</label>"+label+"格式错误");
				$('#'+validEle+'').show();
				$('#'+maskEle+'').show();
				return false;
			};
		}
		else
		{
			if(isCheckNull == 'true')
			{
				$('#'+validEle+'').html("<label>&nbsp;</label>"+label+"不能为空");
				$('#'+validEle+'').show();
				$('#'+maskEle+'').show();
				return false;
			}
			else
			{
				$('#'+validEle+'').hide();
				$('#'+maskEle+'').hide();
				return true;
			}
		}
	}
	function isNull4borrowInfo(label, eleName, validEle, maskEle){
		var flag=false;
		var checkvalue = $("input[name='"+eleName+"']");
		checkvalue.each(function()
		{
			if(this.checked==true)
			{
				flag = true;
			}
		});
		if(!flag)
		{
			$('#'+validEle+'').html("<label>&nbsp;</label>"+label+"不能为空");
			$('#'+validEle+'').show();
			$('#'+maskEle+'').show();
			return false;
		}
		else
		{
			$('#'+validEle+'').hide();
			$('#'+maskEle+'').hide();
			return true;
		}
	}
// borrowInfo数据列表表单提交脚本
function _submitAction4borrowInfo(obj, action, params)
{
		var submitForm;
		while ((obj.parentNode) && (obj.parentNode.tagName) && (!obj.parentNode.tagName.match(/FORM/i)))
		{
			obj = obj.parentNode;
		}
		submitForm = obj.parentNode;
		if(!submitForm)
		{
			submitForm = document.createElement("form");
			document.body.appendChild(submitForm);
		}
		submitForm.setAttribute("action", action);
		submitForm.setAttribute("method", "POST");
		for(var key in params)
		{
				var hiddenField = document.createElement("input");
				hiddenField.setAttribute("type", "hidden");
				hiddenField.setAttribute("name", key);
				hiddenField.setAttribute("value", params[key]);
				submitForm.appendChild(hiddenField);
		}
if(submit4borrowInfo()) submitForm.submit();
}
</script>
<div class="youarehere">标的管理 &gt;<span>待审核标的</span>&gt; <span>新增标的</span>&gt; </div>
<form id="borrowInfo"  action="<%=request.getContextPath()%>/borrowInfo/add" method="POST" onSubmit="return submit4borrowInfo();" enctype="multipart/form-data">
<iframe name="hidden_importfile" id="hidden_importfile" style="display: none;"></iframe>
<table class="data_table_main">
<tr>
<td background="<%=request.getContextPath()%>/layout/list/tab_top.gif">
<!-- borrowInfo标题头 -->
<table class="data_table_title">
<tr>
<td width="12" height="30"><img src="<%=request.getContextPath()%>/layout/list/tab_left_top.gif" width="12" height="30" /></td><td align='left'><img src="<%=request.getContextPath()%>/layout/list/list.gif" width="16" height="16" />新增标的 </td>
<td align='right'>
&nbsp;
</td><td width="16"><img src="<%=request.getContextPath()%>/layout/list/tab_right_top.gif" width="16" height="30" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="<%=request.getContextPath()%>/layout/list/tab_left.gif">&nbsp;</td>
<td>
<!-- borrowInfo数据区 -->
<table id="main_table4borrowInfo" class="data_table_command">
<tr>
<td class="data_tab_tdr">标的名称<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="borrowName" type="text" name="borrowName" value="" />&nbsp;<span style="color:red;">*</span><span style="color:gray;font-style: italic;font-size: small;"></span>
<div id="mask4borrowName" style="display: none;"></div>
<div id="valid4borrowName" style="display: none;color: red;font-size: small;"></div>
</td>
<td class="data_tab_tdr">借款用户<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="borrowUserName" type="text" name="borrowUserName" value="" />&nbsp;<span style="color:red;">*</span><span style="color:gray;font-style: italic;font-size: small;"></span>
<div id="mask4borrowUserName" style="display: none;"></div>
<div id="valid4borrowUserName" style="display: none;color: red;font-size: small;"></div>
</td>
</tr>
<tr>
<td class="data_tab_tdr">还款方式<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><chtml:enum name="repaymentType" textProperty="text" type="com.hengpeng.itfinbase.persist.BorrowInfo$RepaymentType" />
<span style="color:gray;font-style: italic;font-size: small;"></span>
<div id="mask4repaymentType" style="display: none;"></div>
<div id="valid4repaymentType" style="display: none;color: red;font-size: small;"></div>
</td>
<td class="data_tab_tdr">借款金额<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="borrowMoney" type="text" name="borrowMoney" value="" onchange="javascript: valid4borrowInfo('借款金额(元)','^-?[0-9]+$',this.value,'valid4borrowMoney', 'mask4borrowMoney', 'true');" onblur="javascript: valid4borrowInfo('借款金额(元)','^-?[0-9]+$',this.value,'valid4borrowMoney', 'mask4borrowMoney', 'true');" />&nbsp;<span style="color:red;">(单位：元)</span>
<div id="mask4borrowMoney" style="display: none;"></div>
<div id="valid4borrowMoney" style="display: none;color: red;font-size: small;"></div>
</td>
</tr>
<tr>
<td class="data_tab_tdr">年化利率<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="borrowRate" type="text" name="borrowRate" value="" onchange="javascript: valid4borrowInfo('年化利率','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4borrowRate', 'mask4borrowRate', 'true');" onblur="javascript: valid4borrowInfo('年化利率','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4borrowRate', 'mask4borrowRate', 'true');" />&nbsp;<span style="color:red;">%&nbsp(实际年化利率)</span>
<div id="mask4borrowRate" style="display: none;"></div>
<div id="valid4borrowRate" style="display: none;color: red;font-size: small;"></div>
</td>
<td class="data_tab_tdr">附加利率<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="rewardRate" type="text" name="rewardRate" value="" onchange="javascript: valid4borrowInfo('附加利率(平台奖励)','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4rewardRate', 'mask4rewardRate', 'true');" onblur="javascript: valid4borrowInfo('附加利率(平台奖励)','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4rewardRate', 'mask4rewardRate', 'true');" />&nbsp;<span style="color:red;">%&nbsp(平台奖励利率)</span>
<div id="mask4rewardRate" style="display: none;"></div>
<div id="valid4rewardRate" style="display: none;color: red;font-size: small;"></div>
</td>
</tr>
<tr>
<td class="data_tab_tdr">借款周期<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="borrowDuration" type="text" name="borrowDuration" value="" onchange="javascript: valid4borrowInfo('借款周期','^-?[0-9]+$',this.value,'valid4borrowDuration', 'mask4borrowDuration', 'true');" onblur="javascript: valid4borrowInfo('借款周期','^-?[0-9]+$',this.value,'valid4borrowDuration', 'mask4borrowDuration', 'true');" />&nbsp;
<chtml:enum name="durType" textProperty="text" inputType="radio" selected="MONTH" type="com.hengpeng.itfinbase.persist.BorrowInfo$DurationType" />
<div id="mask4borrowDuration" style="display: none;"></div>
<div id="valid4borrowDuration" style="display: none;color: red;font-size: small;"></div>
</td>
<td class="data_tab_tdr">筹款时长<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="raiseDuration" type="text" name="raiseDuration" value="" onchange="javascript: valid4borrowInfo('筹款时长(小时)','^-?[0-9]+$',this.value,'valid4raiseDuration', 'mask4raiseDuration', 'true');" onblur="javascript: valid4borrowInfo('筹款时长(小时)','^-?[0-9]+$',this.value,'valid4raiseDuration', 'mask4raiseDuration', 'true');" />&nbsp;<span style="color:red;">(单位：小时)</span>
<div id="mask4raiseDuration" style="display: none;"></div>
<div id="valid4raiseDuration" style="display: none;color: red;font-size: small;"></div>
</td>
</tr>
<tr>
<td class="data_tab_tdr">最小投标金额<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="minInvest" type="text" name="minInvest" value="" onchange="javascript: valid4borrowInfo('最小投标金额','^-?[0-9]+$',this.value,'valid4minInvest', 'mask4minInvest', 'true');" onblur="javascript: valid4borrowInfo('最小投标金额','^-?[0-9]+$',this.value,'valid4minInvest', 'mask4minInvest', 'true');" />&nbsp;<span style="color:red;">(单位：元)</span>
<div id="mask4minInvest" style="display: none;"></div>
<div id="valid4minInvest" style="display: none;color: red;font-size: small;"></div>
</td>
<td class="data_tab_tdr">最大投标金额<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="maxInvest" type="text" name="maxInvest" value="" onchange="javascript: valid4borrowInfo('最大投标金额','^-?[0-9]+$',this.value,'valid4maxInvest', 'mask4maxInvest', 'true');" onblur="javascript: valid4borrowInfo('最大投标金额','^-?[0-9]+$',this.value,'valid4maxInvest', 'mask4maxInvest', 'true');" />&nbsp;<span style="color:red;">(单位：元)</span>
<div id="mask4maxInvest" style="display: none;"></div>
<div id="valid4maxInvest" style="display: none;color: red;font-size: small;"></div>
</td>
</tr>
<tr>
<td class="data_tab_tdr">投标金额增量<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="incMoney" type="text" name="incMoney" value="" onchange="javascript: valid4borrowInfo('投标金额增量','^-?[0-9]+$',this.value,'valid4incMoney', 'mask4incMoney', 'true');" onblur="javascript: valid4borrowInfo('投标金额增量','^-?[0-9]+$',this.value,'valid4incMoney', 'mask4incMoney', 'true');" />&nbsp;<span style="color:red;">(单位：元)</span>
<div id="mask4incMoney" style="display: none;"></div>
<div id="valid4incMoney" style="display: none;color: red;font-size: small;"></div>
</td>
<td class="data_tab_tdr">借款服务费率<span style="color:red;">*</span></td>
<td class="data_tab_tdl"><input id="borrowFeeRate" type="text" name="borrowFeeRate" value="1" onchange="javascript: valid4borrowInfo('借款服务费率','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4borrowFeeRate', 'mask4borrowFeeRate', 'true');" onblur="javascript: valid4borrowInfo('借款服务费率','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4borrowFeeRate', 'mask4borrowFeeRate', 'true');" />&nbsp;<span style="color:red;">%</span>
<div id="mask4borrowFeeRate" style="display: none;"></div>
<div id="valid4borrowFeeRate" style="display: none;color: red;font-size: small;"></div>
</td>
</tr>

<tr>
	<td class="data_tab_tdr">借款担保费率<span style="color:red;">*</span></td>
	<td class="data_tab_tdl">
		<input id="guaranteeFeeRate" type="text" name="guaranteeFeeRate" value="2" onchange="javascript: valid4borrowInfo('借款管理费率','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4guaranteeFeeRate', 'mask4guaranteeFeeRate', 'true');" onblur="javascript: valid4borrowInfo('借款管理费率','^[0-9]+(\\.[0-9]+)?$',this.value,'valid4guaranteeFeeRate', 'mask4guaranteeFeeRate', 'true');" />&nbsp;<span style="color:red;">%</span>
		<div id="mask4guaranteeFeeRate" style="display: none;"></div>
		<div id="valid4guaranteeFeeRate" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
		
	</td>
</tr>

<tr>
	<td class="data_tab_tdr">是否能提供抵押物</td>
	<td class="data_tab_tdl">
		<select name="hasmortgage">
   			<option value="YES">能提供</option>
   			<option value="NO">无法提供</option>
   		</select>
   		
		<div id="mask4hasmortgage" style="display: none;"></div>
		<div id="valid4hasmortgage" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">借款用途</td>
	<td class="data_tab_tdl">
		<input id="userFor" type="text" name="userFor" value=""  />&nbsp;
		<div id="mask4userFor" style="display: none;"></div>
		<div id="valid4userFor" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>

<tr>
	<td class="data_tab_tdr">可接受的最大年利率</td>
	<td class="data_tab_tdl">
		<input id="maxBearborrowRate" type="text" name="maxBearborrowRate" value=""  />&nbsp;<span style="color:red;">%</span>
		<div id="mask4maxBearborrowRate" style="display: none;"></div>
		<div id="valid4maxBearborrowRate" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
	</td>
</tr>

<tr>
	<td class="data_tab_tdr" colspan="4" align="center">企业经营信息</td>
</tr>
<tr>
	<td class="data_tab_tdr">上年度营业额</td>
	<td class="data_tab_tdl">
		<input id="lastyearsell" type="text" name="lastyearsell" value=""  />&nbsp;
		<div id="mask4lastyearsell" style="display: none;"></div>
		<div id="valid4lastyearsell" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">上年度资产负债率</td>
	<td class="data_tab_tdl">
		<input id="lastyearfzl" type="text" name="lastyearfzl" value=""  />&nbsp;
		<div id="mask4lastyearfzl" style="display: none;"></div>
		<div id="valid4lastyearfzl" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>

<tr>
	<td class="data_tab_tdr">上年度销售成本</td>
	<td class="data_tab_tdl">
		<input id="lastyearsellcb" type="text" name="lastyearsellcb" value=""  />&nbsp;
		<div id="mask4lastyearsellcb" style="display: none;"></div>
		<div id="validlastyearsellcb" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">上年度净利润</td>
	<td class="data_tab_tdl">
		<input id="lastyearjlr" type="text" name="lastyearjlr" value=""  />&nbsp;
		<div id="mask4lastyearjlr" style="display: none;"></div>
		<div id="valid4lastyearjlr" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>

<tr>
	<td class="data_tab_tdr">上传企业上年度利润表(上传)</td>
	<td class="data_tab_tdl">
				<input type="hidden" name="profitfilename" id="profitfilename">
            	<input type="hidden" name="profitfilepath" id="profitfilepath">
            	<span id="showupfile_profit"></span>
            	<a href="#" class="a_upfile" id="profit_upfile">
					    点击上传<input class="upfile" type="file" name="profit" id="profit" onchange="importprofit()"/>
				</a>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
	</td>
</tr>
<tr>
	<td class="data_tab_tdr" colspan="4" align="center">企业工商信息公示栏</td>
</tr>
<tr>
	<td class="data_tab_tdr">营业执照注册号</td>
	<td class="data_tab_tdl">
		<input id="yyzz" type="text" name="yyzz" value=""  />&nbsp;
		<div id="mask4yyzz" style="display: none;"></div>
		<div id="valid4yyzz" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">企业法人</td>
	<td class="data_tab_tdl">
		<input id="qifr" type="text" name="qifr" value=""  />&nbsp;
		<div id="mask4qifr" style="display: none;"></div>
		<div id="valid4qifr" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">是否有被公示不良记录</td>
	<td class="data_tab_tdl">
		<select name="isunlegal">
   			<option value="YES">有</option>
   			<option value="NO">没有</option>
   		</select>
		<div id="mask4isunlegal" style="display: none;"></div>
		<div id="valid4isunlegal" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">办公地址</td>
	<td class="data_tab_tdl">
		<input id="businessaddress" type="text" name="businessaddress" value=""  />&nbsp;
		<div id="mask4businessaddress" style="display: none;"></div>
		<div id="valid4businessaddress" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">联系电话</td>
	<td class="data_tab_tdl">
		<input id="linkmobile" type="text" name="linkmobile" value=""  />&nbsp;
		<div id="mask4linkmobile" style="display: none;"></div>
		<div id="valid4linkmobile" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">上传法人身份证：（正面）（反面）</td>
	<td class="data_tab_tdl">
		<input type="hidden" name="idfrontfilename" id="idfrontfilename"/>
                            	<input type="hidden" name="idfrontfilepath" id="idfrontfilepath"/>
                            	<input type="hidden" name="idbackfilename" id="idbackfilename"/>
                            	<input type="hidden" name="idbackfilepath" id="idbackfilepath"/>
	                            <p>
	                            	<span id="showupfile_front"></span>&nbsp;&nbsp;
	                            	<span id="showupfile_back"></span>
	                            </p>
                            	<a href="#" class="a_upfile" id="front_upfile">
									    上传正面<input class="upfile" type="file" name="idfront" id="idfront" onchange="importidfront()"/>
								</a>
                            	<a href="#" class="a_upfile" id="back_upfile">
									    上传反面<input class="upfile" type="file" name="idback" id="idback" onchange="importidback()"/>
								</a>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">上传企业银行开户许可证</td>
	<td class="data_tab_tdl">
		<input type="hidden" name="bankpermitfilename" id="bankpermitfilename">
                            	<input type="hidden" name="bankpermitfilepath" id="bankpermitfilepath">
                            	<span id="showupfile_bankpermit"></span>
                            	<a href="#" class="a_upfile" id="bankpermit_upfile">
									    点击上传<input class="upfile" type="file" name="bankpermit" id="bankpermit" onchange="importbankpermit()"/>
								</a>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
	</td>
</tr>
<!--风控信息  -->
<tr>
	<td class="data_tab_tdr" colspan="4" align="center">风控信息</td>
</tr>
<tr>
	<td class="data_tab_tdr">担保机构<span style="color:red;">*</span></td>
	<td class="data_tab_tdl">
		<chtml:enum name="guaranteeUserId" textProperty="realName" valueProperty="id" itemsName="guartors" type="com.hengpeng.itfinbase.persist.UserInfo" />
		<div id="mask4guaranteeUserId" style="display: none;"></div>
		<div id="valid4guaranteeUserId" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">担保机构说明</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="guaranteeDesc" id="guaranteeDesc"></textarea>&nbsp;
		<div id="mask4guaranteeDesc" style="display: none;"></div>
		<div id="valid4guaranteeDesc" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">担保情况</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="guaranteeCondition" id="guaranteeCondition"></textarea>&nbsp;
		<div id="mask4yguaranteeCondition" style="display: none;"></div>
		<div id="valid4guaranteeCondition" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">风险控制措施</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="dangerDesc" id="dangerDesc"></textarea>&nbsp;
		<div id="mask4dangerDesc" style="display: none;"></div>
		<div id="valid4dangerDesc" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">反担保情况</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="fguaranteeCondition" id="fguaranteeCondition"></textarea>&nbsp;
		<div id="mask4fguaranteeCondition" style="display: none;"></div>
		<div id="valid4fguaranteeCondition" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
	</td>
</tr>
<!--风控信息  -->

<!--抵押物信息  -->
<tr>
	<td class="data_tab_tdr" colspan="4" align="center">抵押物信息</td>
</tr>
<tr>
	<td class="data_tab_tdr">股权<span style="color:red;">*</span></td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="mortgage_stock" id="mortgage_stock"></textarea>&nbsp;
		<div id="mask4mortgage_stock" style="display: none;"></div>
		<div id="valid4mortgage_stock" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">房产</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="mortgage_house" id="mortgage_house"></textarea>&nbsp;
		<div id="mask4mortgage_house" style="display: none;"></div>
		<div id="valid4mortgage_house" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">土地</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="mortgage_land" id="mortgage_land"></textarea>&nbsp;
		<div id="mask4mortgage_land" style="display: none;"></div>
		<div id="valid4mortgage_land" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr">实物</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="mortgage_stuff" id="mortgage_stuff"></textarea>&nbsp;
		<div id="mask4dangerDesc" style="display: none;"></div>
		<div id="valid4dangerDesc" style="display: none;color: red;font-size: small;"></div>
	</td>
</tr>
<tr>
	<td class="data_tab_tdr">其他资产</td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="mortgage_other" id="mortgage_other"></textarea>&nbsp;
		<div id="mask4mortgage_other" style="display: none;"></div>
		<div id="valid4mortgage_other" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
	</td>
</tr>


<!--活动详情信息  -->
<tr>
	<td class="data_tab_tdr" colspan="4" align="center">活动详情</td>
</tr>
<tr>
	<td class="data_tab_tdr">活动详情<span style="color:red;">*</span></td>
	<td class="data_tab_tdl">
		<textarea rows="10" cols="10" name="active_desc" id="active_desc"></textarea>&nbsp;
		<div id="mask4active_desc" style="display: none;"></div>
		<div id="valid4active_desc" style="display: none;color: red;font-size: small;"></div>
	</td>
	<td class="data_tab_tdr"></td>
	<td class="data_tab_tdl">
	</td>
</tr>


<tr>
<td colspan="4" align="center" height="25" class="data_tab_td">
	<button type="button" onclick="javascript:if(true){void(_submitAction4borrowInfo(this,'<%=request.getContextPath()%>/borrowInfo/add',{}));return false;}"  />·新增·</button>&nbsp;&nbsp;
	<button type="button" onclick="javascript:void(history.back(-1))" >·返回·</button>
</td>
</tr>
</table>
</td>
<td width="8" background="<%=request.getContextPath()%>/layout/list/tab_right.gif">&nbsp;</td> </tr>
</table>
</td>
</tr>
<tr>
<td background="<%=request.getContextPath()%>/layout/list/tab_bottom.gif">
<table class="data_table_pagination" align='center' cellpadding='0' cellspacing='0'>
<tr><td width="12" height="35"><img src="<%=request.getContextPath()%>/layout/list/tab_left_bottom.gif" width="12" height="35" /></td><td>&nbsp;</td><td width="16"><img src="<%=request.getContextPath()%>/layout/list/tab_right_bottom.gif" width="16" height="35" /></td></tr></table>
</td>
</tr>
</table>
<!-- borrowInfo结束 -->
<input id="id" type="hidden" name="id" value="" />
<input id="token" type="hidden" name="token" value="${token}" />
</form>
<script type="text/javascript">
 	function submit4borrowInfo(){
		var validResult = true;
		if(validResult){
			validResult = valid4borrowInfo('标的名称','^[\\s\\S]*$',$('#borrowName').val(),'valid4borrowName', 'mask4borrowName', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('借款用户','^[\\s\\S]*$',$('#borrowUserName').val(),'valid4borrowUserName', 'mask4borrowUserName', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('还款方式','^[\\s\\S]*$',$('#repaymentType').val(),'valid4repaymentType', 'mask4repaymentType', 'false');
		}
		if(validResult){
			validResult = valid4borrowInfo('借款金额(元)','^-?[0-9]+$',$('#borrowMoney').val(),'valid4borrowMoney', 'mask4borrowMoney', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('年化利率','^[0-9]+(\\.[0-9]+)?$',$('#borrowRate').val(),'valid4borrowRate', 'mask4borrowRate', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('周期类型','^[\\s\\S]*$',$('#durType').val(),'valid4durType', 'mask4durType', 'false');
		}
		if(validResult){
			validResult = valid4borrowInfo('借款周期','^-?[0-9]+$',$('#borrowDuration').val(),'valid4borrowDuration', 'mask4borrowDuration', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('筹款时长(小时)','^-?[0-9]+$',$('#raiseDuration').val(),'valid4raiseDuration', 'mask4raiseDuration', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('附加利率(平台奖励)','^[0-9]+(\\.[0-9]+)?$',$('#rewardRate').val(),'valid4rewardRate', 'mask4rewardRate', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('最小投标金额','^-?[0-9]+$',$('#minInvest').val(),'valid4minInvest', 'mask4minInvest', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('最大投标金额','^-?[0-9]+$',$('#maxInvest').val(),'valid4maxInvest', 'mask4maxInvest', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('投标金额增量','^-?[0-9]+$',$('#incMoney').val(),'valid4incMoney', 'mask4incMoney', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('借款服务费率','^[0-9]+(\\.[0-9]+)?$',$('#borrowFeeRate').val(),'valid4borrowFeeRate', 'mask4borrowFeeRate', 'true');
		}
		if(validResult){
			validResult = valid4borrowInfo('借款担保费率','^[0-9]+(\\.[0-9]+)?$',$('#guaranteeFeeRate').val(),'valid4guaranteeFeeRate', 'mask4guaranteeFeeRate', 'true');
		}
		if(validResult){
			var borrowMoney =$('#borrowMoney').val();
			var maxInvest =$('#maxInvest').val();
			var incMoney =$('#incMoney').val();
			if(parseInt(borrowMoney)<parseInt(maxInvest)){
				alert("最大投标金额不允许大于借款金额!");
				return false;
			}
			if(parseInt(borrowMoney)<parseInt(incMoney)){
				alert("投标增量金额不允许大于最大投标金额!");
				return false;
			}
			if(parseInt(incMoney)<0){
				alert("投标增量金额不允许小于0!");
				return false;
			}
			if(parseInt(borrowMoney)<0){
				alert("借款金额不允许小于0!");
				return false;
			}
		}
		if(validResult){
			var minInvest =$('#minInvest').val();
			var maxInvest =$('#maxInvest').val();
			if(parseInt(minInvest)<0){
				alert("最小投标金额不允许小于0");
				return false;
			}
			if(parseInt(minInvest)>parseInt(maxInvest)){
				alert("最小投标金额不允许大于最大投标金额!");
				return false;
			}
		}
		if(validResult){
			var repayType =$('#repaymentType').val();
			var durType =$("input[name='durType']:checked").val();
			if(repayType=='EQUALINTEREST' || repayType=='EQUALPRINCIPAL' || repayType=='MONTHINTEREST')
			{
				if(durType=='DAY')
				{
					alert("等额本金,等额本息,按月付息到期还本等还款方式借款周期必须选择月");
					validResult=false;
				}
			}
		}
		if(validResult){
			var borrowRate =$('#borrowRate').val();
			var rs = borrowRate.indexOf('.');  
			if(rs>0){
				while (borrowRate.length <= rs + 2) {  
					borrowRate += '0';  
	            }
			}
			var reg = new RegExp("^[0-9]+(.[0-9]{2})?$", "g");
	        if (!reg.test(borrowRate)) {  
	        	alert("年化利率必须保留2位小数");
	            validResult=false; 
	        }
	        if(parseFloat(borrowRate)>50){
	        	alert("年化利率最大不能超过50%，同时不能小于0");
	        	validResult=false; 
	        }
		}
		if(validResult){
			var rewardRate =$('#rewardRate').val();
			var rs = rewardRate.indexOf('.');  
			if(rs>0){
				while (rewardRate.length <= rs + 2) {  
					rewardRate += '0';  
	            }
			}
			var reg = new RegExp("^[0-9]+(.[0-9]{2})?$", "g");
	        if (!reg.test(rewardRate)) {  
	        	alert("附加利率必须保留2位小数");
	        	return false;
	        }
	        if(parseFloat(rewardRate)>50){
	        	alert("附加利率最大不能超过50%");
	        	return false;
	        }
		}
		return validResult;
	}
	new ResizeWidget('main_table4borrowInfo');
</script>
<script type="text/javascript">
function importidfront() {//上传身份证正面
	$("#idback").remove();
	$("#bankpermit").remove();
	$("#profit_upfile").remove();
  	$("#borrowInfo").attr("action" , "<%=request.getContextPath()%>/borrowInfo/importidfront?type=front");
	$("#borrowInfo").attr("target","hidden_importfile");
 	$("#borrowInfo").submit();
}
function importidback() {//上传身份证反面
	$("#idfront").remove();
	$("#bankpermit").remove();
	$("#profit_upfile").remove();
  	$("#borrowInfo").attr("action" , "<%=request.getContextPath()%>/borrowInfo/importidback?type=back");
	$("#borrowInfo").attr("target","hidden_importfile");
 	$("#borrowInfo").submit();
}
function importbankpermit() {//上传银行许可证
	$("#idfront").remove();
	$("#idback").remove();
	$("#profit_upfile").remove();
  	$("#borrowInfo").attr("action" , "<%=request.getContextPath()%>/borrowInfo/importbankpermit?type=bankpermit");
	$("#borrowInfo").attr("target","hidden_importfile");
 	$("#borrowInfo").submit();
}

function importprofit() {//上传上年度利润报表
	$("#idfront").remove();
	$("#idback").remove();
	$("#bankpermit").remove();
  	$("#borrowInfo").attr("action" , "<%=request.getContextPath()%>/borrowInfo/importprofit?type=profit");
	$("#borrowInfo").attr("target","hidden_importfile");
 	$("#borrowInfo").submit();
}
function setshow (filename, path,info, type) {//显示已经上传的文件
	if (info == "success") {
		if (type == "front") {//上传身份证正面
			$("#showupfile_front").append("<a href='"+path+"' target='_blank'>"+filename+"</a></br>");
			
			$("#back_upfile").append('<input class="upfile" type="file" name="idback" id="idback" onchange="importidback()"/>');
			$("#bankpermit_upfile").append('<input class="upfile" type="file" name="bankpermit" id="bankpermit" onchange="importbankpermit()"/>');
			$("#profit_upfile").append('<input class="upfile" type="file" name="profit" id="profit" onchange="importprofit()"/>');
			
			$("#idfrontfilename").val(filename);
			$("#idfrontfilepath").val(path);
		}
		if (type == "back") {//上传身份证背面
			$("#showupfile_back").append("<a href='"+path+"' target='_blank'>"+filename+"</a></br>");
			
			$("#front_upfile").append('<input class="upfile" type="file" name="idfront" id="idfront" onchange="importidfront()"/>');
			$("#bankpermit_upfile").append('<input class="upfile" type="file" name="bankpermit" id="bankpermit" onchange="importbankpermit()"/>');
			$("#profit_upfile").append('<input class="upfile" type="file" name="profit" id="profit" onchange="importprofit()"/>');
			
			$("#idbackfilename").val(filename);
			$("#idbackfilepath").val(path);
		}
		if (type =="bankpermit") {//上传银行开户许可证
			$("#showupfile_bankpermit").append("<a href='"+path+"' target='_blank'>"+filename+"</a></br>");
			
			$("#back_upfile").append('<input class="upfile" type="file" name="idback" id="idback" onchange="importidback()"/>');
			$("#front_upfile").append('<input class="upfile" type="file" name="idfront" id="idfront" onchange="importidfront()"/>');
			$("#profit_upfile").append('<input class="upfile" type="file" name="profit" id="profit" onchange="importprofit()"/>');
			
			$("#bankpermitfilename").val(filename);
			$("#bankpermitfilepath").val(path);
		}
		if (type == "profit") {//上传上年度利润报表
			$("#showupfile_profit").append("<a href='"+path+"' target='_blank'>"+filename+"</a></br>");
			
			$("#back_upfile").append('<input class="upfile" type="file" name="idback" id="idback" onchange="importidback()"/>');
			$("#front_upfile").append('<input class="upfile" type="file" name="idfront" id="idfront" onchange="importidfront()"/>');
			$("#bankpermit_upfile").append('<input class="upfile" type="file" name="bankpermit" id="bankpermit" onchange="importbankpermit()"/>');
			
			$("#profitfilename").val(filename);
			$("#profitfilepath").val(path);
		}
	}
	$("#borrowInfo").attr("action" , "<%=request.getContextPath()%>/borrowInfo/add");
	$("#borrowInfo").removeAttr("target");
}
</script>
<style type="text/css">
td.data_tab_tdl #durType{
font: 12px Tahoma;
padding: 2px 6px;
margin: 0 5px 0 8px;
height: 18px;
width: 18px;}
</style>
</body>
</html>